package com.dao.impl;

import java.util.List;

import org.hibernate.Query;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.dao.UserimgDao;
import com.enetiy.Userimg;

public class UserimgDaoImpl extends HibernateDaoSupport implements UserimgDao {

	
	public List<Userimg> selectUser(int id) throws Exception {
		Query query = this.getSession().createQuery("from Userimg where uid=?");
		query.setParameter(0, id);
		List<Userimg> list = query.list();
		return list;
	}

	
	public void deleteUserImg(Userimg ui) throws Exception {
		this.getHibernateTemplate().delete(ui);
	}

	
	public void insetrUserImg(Userimg ui) throws Exception {
		this.getHibernateTemplate().save(ui);
	}

	
	public Userimg selectUserImg(int id) throws Exception {
		Userimg userimg = this.getHibernateTemplate().get(Userimg.class, id);
		return userimg;
	}

}
